<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * @var $block \Magento\Authorizenet\Block\Transparent\Iframe
 */
$params = $block->getParams();
$helper = $block->getHelper('adminhtml');
?>
<html>
    <head>
        <script>
        <?php if (isset($params['redirect'])): ?>
            window.location="<?php echo $block->escapeUrl($params['redirect']); ?>";
        <?php endif; ?>
        <?php if (isset($params['redirect_parent'])): ?>
            window.top.location="<?php echo $block->escapeUrl($params['redirect_parent']); ?>";
        <?php endif; ?>
        <?php if (isset($params['error_msg'])): ?>
            window.top.directPostModel.showError(<?php /* @noEscape */ echo json_encode((array)$params['error_msg']); ?>);
            <?php if (isset($params['x_invoice_num'])): ?>
                window.top.directPostModel.successUrl="<?php echo $block->escapeUrl($helper->getSuccessOrderUrl($params)); ?>";
            <?php endif; ?>
        <?php endif; ?>
        </script>
    </head>
    <body></body>
</html>
